#ifndef WIDGET_H
#define WIDGET_H

#include <QWidget>
#include <QWebSocket>
#include <QUrl>
#include <QDebug>

QT_BEGIN_NAMESPACE
namespace Ui {
class Widget;
}
QT_END_NAMESPACE

class Widget : public QWidget
{
    Q_OBJECT

public:
    Widget(QWidget *parent = nullptr);
    ~Widget();
    void sendMessage(const QString &message);
private slots:
    void on_pushButton_clicked();
    void onConnected();

    void onError(QAbstractSocket::SocketError error);

    void onDisconnected();
private:
    Ui::Widget *ui;
    QWebSocket *webSocket;
};
#endif // WIDGET_H
